/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.me.androidhelloapplication;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import com.google.tts.TTS;

/**
 *
 * @author rlutz
 */
public class TTSSMSService extends Service {
    private TTS myTts;

/** not using ipc... dont care about this method */
public IBinder onBind(Intent intent) {
  return null;
}

@Override
public void onCreate() {
  super.onCreate();

  // init the service here
  _startService();

  //if (MAIN_ACTIVITY != null) AppUtils.showToastShort(MAIN_ACTIVITY, "MyService started");
}

@Override
public void onDestroy() {
  super.onDestroy();

  _shutdownService();

  //if (MAIN_ACTIVITY != null) AppUtils.showToastShort(MAIN_ACTIVITY, "MyService stopped");
}

private void _startService() {

  Log.i(getClass().getSimpleName(), "service started");
  myTts = new TTS(this, ttsInitListener, true);
}

private void _shutdownService() {

  Log.i(getClass().getSimpleName(), "service stopped");
}




    private TTS.InitListener ttsInitListener = new TTS.InitListener() {
        public void onInit(int version) {

          myTts.speak("I own eight pizza pies. Dad better go get Alton!", 0, null);
        }
    };





}

